import javax.swing.JComponent;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Rectangle;

public class IntersectionComponent extends JComponent
{
   public void paintComponent(Graphics g)
   {
      Graphics2D g2 = (Graphics2D) g;
      Rectangle box1 = new Rectangle(5, 10, 100, 120);
      Rectangle box2 = new Rectangle(50, 60, 100, 120);
      // your work here
      int r=generator.nextInt(MAX_RADIUS);
     int x=generator.nextInt(getWidth());
     int y=generator.nextInt(getHeight());
     for(int i=0;i<40;i++)
     {
     Color c=new Color(generator.nextInt(255),generator.nextInt(255),generator.nextInt(255));
     Balloon b=new Balloon(x,y,r,c);
     b.draw(g2);
     }
      
   }
}